#ifndef CUBE_PRIMITIVE_H
#define CUBE_PRIMITIVE_H

namespace CubE
{
   class Quaternion;
      
   class Vector3
   {
   public:

      static const Vector3 UNIT_X;
      static const Vector3 UNIT_Y;
      static const Vector3 UNIT_Z;
      static const Vector3 ZERO;

      Vector3(void);
      Vector3(Vector3 const& other);
      Vector3(Vector3& other);
      Vector3(float x, float y, float z);
      Vector3& operator=(const Vector3& vec);
      Vector3 operator+(const Vector3& vec) const ;
      Vector3& operator+=(const Vector3& vec) ;
      Vector3 operator-(const Vector3& vec) const ;      
      Vector3 operator*(float factor) const;
      bool operator==(const Vector3& vec) const ;
      bool operator!=(const Vector3& vec) const ;
      
      //access
      float operator[](int i) const; 
      bool Set(int i, float val);
      void Set(float val[3]);
      void Set(float xval, float yval, float zval);
      float Get(int i);
      void Get(float val[3]);
      void Get(float& xval, float& yval, float& zval);
      typedef enum Component_s{
	 _X, _Y, _Z
      }Component;
      float Get(Component compo);
      
      //mathmatic attributes
      float Normalize(void);
      bool IsNormalized(void);
      float GetLength(void);
      Vector3 CrossProduct(const Vector3& other) const;
      float DotProduct(const Vector3& other) const;

      //advanced features
      Vector3 Rotate(const Quaternion& q) const;
   
   private:
      float _x, _y, _z;
   };

}


#endif//  CUBE_PRIMITIVE_H
